1. Technical Field
The present invention relates to data processing systems and, in particular, to performing a scan dump in the event of a system error. Still more particularly, the present invention provides a method, apparatus, and program for dynamically sizing and allocating memory for dump list generation.
2. Description of Related Art
Some servers use diagnostic code to indicate failing components in the event of a system error. In many cases, however, these diagnostic codes are not sufficient to determine the nature of the failure. In these cases, selected chip data is saved in the event of a failure. Engineers may use this data to determine machine state and further diagnose the problem.
The process of saving this chip data is called a scan dump. The data, referred to as scan data, may contain various hardware dump information elements, such as scan ring, trace array, cache contents, and cache directory contents. During a complete dump the total dump set is dumped. However, depending on the error condition or user configuration, the system may decide to dump only a portion of the total dump set. This is referred to as an abbreviated dump.
When a dump is executed, the diagnostic code allocates memory for a dump list. The diagnostic code then builds the table and includes a list of hardware dump information elements to be collected based on the type of dump to be performed. To do this, the dump routine maintains a set of static arrays containing constants, each of which represents a scan ring or trace array, for example, to be dumped. The routine then iterates through the arrays to build the scan dump list. Another function is called for every entry in the dump list. This function collects hardware dump data and saves it into memory.
This process of executing a dump has several disadvantages. The process has multiple points of maintenance. If the static arrays are modified, for example a particular array is made bigger or smaller by adding or deleting constants, the iteration loops break because the information they have on how many entries they have to iterate through is inaccurate. In addition, the amount of memory allocated for the dump list is calculated using a predefined constant. The function used to allocate memory space for the list would have to be updated every time the number of possible dump list entries is changed.
Furthermore, the above process of executing a dump may result in memory waste. The function used to allocate memory space determines an amount of memory that would be needed for a complete dump. However, there may be several abbreviated dump modes that do not require nearly as much space. Therefore, if the diagnostic code is in one of the abbreviated dump modes, the process may allocate much more memory than is actually used.
Thus, it would be advantageous to provide an improved method, apparatus, and program for dynamically sizing and allocating memory for dump list generation.